﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows;

namespace ShapeDemo
{
    

    /// <summary>
    /// 鼠标状态，指针或者描绘
    /// </summary>
    enum TMouse { Point,Drawing }

    /// <summary>
    /// 实例化资源类
    /// </summary>
    public class ResourceCenter
    {
        /// <summary>
        /// 实例化一个新区域
        /// </summary>
        /// <returns></returns>
        public static ASPNETX_WPFPolygon NewPolygon()
        {
            ASPNETX_WPFPolygon pgBody = new ASPNETX_WPFPolygon();
            pgBody.PolygonBody.Stroke = new SolidColorBrush(Colors.Black);
            pgBody.PolygonBody.StrokeThickness = 2;
            pgBody.PolygonBody.Fill = new SolidColorBrush(Colors.Blue);

            //增加一个空点以实现辅助线的效果
            pgBody.PolygonBody.Points.Add(new Point());

            return pgBody;
        }

        /// <summary>
        /// 实例化一个新连续线
        /// </summary>
        /// <returns></returns>
        public static ASPNETX_WPFPolyline NewPolyline()
        {
            ASPNETX_WPFPolyline plBody = new ASPNETX_WPFPolyline();

            //Polyline plBody = new Polyline();
            plBody.PolylineBody.Stroke = new SolidColorBrush(Colors.Black);
            plBody.PolylineBody.StrokeThickness = 5;

            //增加一个空点以实现辅助线的效果
            plBody.PolylineBody.Points.Add(new Point());

            return plBody;
        }

        /// <summary>
        /// 实例化一个新矩形
        /// </summary>
        /// <returns></returns>
        public static ASPNETX_WPFRect NewRect()
        {
            ASPNETX_WPFRect rectBody = new ASPNETX_WPFRect();
            rectBody.RectBody.Fill = new SolidColorBrush(Colors.Blue);
            rectBody.RectBody.Stroke = new SolidColorBrush(Colors.Black);
            rectBody.RectBody.StrokeThickness = 2;

            return rectBody;
        }

        /// <summary>
        /// 实例化一个新圆
        /// </summary>
        /// <returns></returns>
        public static ASPNETX_WPFEllipse NewEllipse()
        {
            ASPNETX_WPFEllipse ellipseBody = new ASPNETX_WPFEllipse();
            ellipseBody.EllipseBody.Fill = new SolidColorBrush(Colors.Blue);
            ellipseBody.EllipseBody.Stroke = new SolidColorBrush(Colors.Black);
            ellipseBody.EllipseBody.StrokeThickness = 2;

            return ellipseBody;
        }
    }
}
